/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * CustumerFrame.java
 *
 * Created on 16-06-2011, 13:47:18
 */
package ui.gui;

import model.DuplicateCustomerIdentifierException;
import controller.CustomerController;
import java.util.regex.Pattern;
import javax.swing.JOptionPane;
import javax.swing.ListSelectionModel;
import javax.swing.RowFilter;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.TableRowSorter;
import model.Customer;
import ui.gui.table.model.CustomerTableModel;

/**
 *
 * @author Martin Mohr Pedersen
 */
public class CustomerFrame extends javax.swing.JFrame {

    private CustomerController controller;
    private CustomerTableModel tableModel;
    private Customer selectedCustomer;

    /** Creates new form CustumerFrame */
    public CustomerFrame() {
        controller = new CustomerController();
        setDefaultCloseOperation(DISPOSE_ON_CLOSE);
        initComponents();
        initTable();
    }

    private void initTable() {
        tableModel = new CustomerTableModel();
        tblCustomers.setModel(tableModel);

        ListSelectionModel selectionModel = tblCustomers.getSelectionModel();
        selectionModel.addListSelectionListener(new ListSelectionListener() {

            @Override
            public void valueChanged(ListSelectionEvent e) {
                if (e.getValueIsAdjusting()) {
                    return;
                }

                int index = tblCustomers.convertRowIndexToModel(tblCustomers.getSelectedRow());
                selectedCustomer = tableModel.getCustomerAtIndex(index);
                updateCustomerFields();

            }
        });
    }

    private void filterTable() {
        TableRowSorter<CustomerTableModel> sorter = new TableRowSorter<CustomerTableModel>(tableModel);
        tblCustomers.setRowSorter(sorter);

        String filterText = txtSearchCustomer.getText();
        System.out.println(filterText);


        if (filterText.length() == 0) {
            sorter.setRowFilter(null);
        } else {
            try {
                sorter.setRowFilter(RowFilter.regexFilter("(?i)" + Pattern.quote(filterText)));
            } catch (Exception e) {
                // TODO: Log failures
            }
        }
    }

    private void updateCustomerFields() {
        Customer customer = selectedCustomer;

        if (customer == null) {
            customer = new Customer();
            btnCustomerInfoEditCustomer.setEnabled(false);
        } else {
            btnCustomerInfoEditCustomer.setEnabled(true);
        }

        txtCustomerInfoPhone.setText(Integer.toString(customer.getPhone()));
        txtCustomerInfoName.setText(customer.getName());
        txtCustomerInfoAddress.setText(customer.getAddress());
        txtCustomerInfoZipCode.setText(Integer.toString(customer.getZipCode()));
        txtCustomerInfoCity.setText(customer.getCity());

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlSearch = new javax.swing.JPanel();
        txtSearchCustomer = new javax.swing.JTextField();
        btnSearchCustomerClear = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblCustomers = new javax.swing.JTable();
        pnlEdit = new javax.swing.JPanel();
        lblCustomerInfoPhoneNoTxt = new javax.swing.JLabel();
        lblCustomerInfoNameTxt = new javax.swing.JLabel();
        lblCustomerInfoAddressTxt = new javax.swing.JLabel();
        lblCustomerInfoZipCodeTxt = new javax.swing.JLabel();
        lblCustomerInfoCityTxt = new javax.swing.JLabel();
        txtCustomerInfoPhone = new javax.swing.JTextField();
        txtCustomerInfoName = new javax.swing.JTextField();
        txtCustomerInfoAddress = new javax.swing.JTextField();
        txtCustomerInfoZipCode = new javax.swing.JTextField();
        txtCustomerInfoCity = new javax.swing.JTextField();
        btnCustomerInfoCreateCustomer = new javax.swing.JButton();
        btnCustomerInfoEditCustomer = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(860, 280));

        pnlSearch.setBorder(javax.swing.BorderFactory.createTitledBorder("Søg efter kunde"));

        txtSearchCustomer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtSearchCustomerActionPerformed(evt);
            }
        });
        txtSearchCustomer.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txtSearchCustomerKeyReleased(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtSearchCustomerKeyTyped(evt);
            }
        });

        btnSearchCustomerClear.setText("Ryd");
        btnSearchCustomerClear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSearchCustomerClearActionPerformed(evt);
            }
        });

        tblCustomers.setAutoCreateRowSorter(true);
        tblCustomers.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        tblCustomers.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        tblCustomers.getTableHeader().setReorderingAllowed(false);
        jScrollPane1.setViewportView(tblCustomers);

        javax.swing.GroupLayout pnlSearchLayout = new javax.swing.GroupLayout(pnlSearch);
        pnlSearch.setLayout(pnlSearchLayout);
        pnlSearchLayout.setHorizontalGroup(
            pnlSearchLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlSearchLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlSearchLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 490, Short.MAX_VALUE)
                    .addGroup(pnlSearchLayout.createSequentialGroup()
                        .addComponent(txtSearchCustomer, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnSearchCustomerClear)))
                .addContainerGap())
        );
        pnlSearchLayout.setVerticalGroup(
            pnlSearchLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlSearchLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlSearchLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtSearchCustomer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnSearchCustomerClear))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 277, Short.MAX_VALUE)
                .addContainerGap())
        );

        pnlEdit.setBorder(javax.swing.BorderFactory.createTitledBorder("Kundeinformationer"));

        lblCustomerInfoPhoneNoTxt.setText("Telefonnr:");

        lblCustomerInfoNameTxt.setText("Navn:");

        lblCustomerInfoAddressTxt.setText("Adresse:");

        lblCustomerInfoZipCodeTxt.setText("Postnr:");

        lblCustomerInfoCityTxt.setText("By:");

        txtCustomerInfoPhone.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtCustomerInfoPhoneActionPerformed(evt);
            }
        });
        txtCustomerInfoPhone.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                txtCustomerInfoPhoneFocusGained(evt);
            }
        });

        txtCustomerInfoName.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                txtCustomerInfoNameFocusGained(evt);
            }
        });

        txtCustomerInfoAddress.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                txtCustomerInfoAddressFocusGained(evt);
            }
        });

        txtCustomerInfoZipCode.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                txtCustomerInfoZipCodeFocusGained(evt);
            }
        });

        txtCustomerInfoCity.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                txtCustomerInfoCityFocusGained(evt);
            }
        });

        btnCustomerInfoCreateCustomer.setText("Opret kunde");
        btnCustomerInfoCreateCustomer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCustomerInfoCreateCustomerActionPerformed(evt);
            }
        });

        btnCustomerInfoEditCustomer.setText("Gem ændringer");
        btnCustomerInfoEditCustomer.setEnabled(false);
        btnCustomerInfoEditCustomer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCustomerInfoEditCustomerActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnlEditLayout = new javax.swing.GroupLayout(pnlEdit);
        pnlEdit.setLayout(pnlEditLayout);
        pnlEditLayout.setHorizontalGroup(
            pnlEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlEditLayout.createSequentialGroup()
                .addGroup(pnlEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(pnlEditLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(btnCustomerInfoEditCustomer)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnCustomerInfoCreateCustomer))
                    .addGroup(pnlEditLayout.createSequentialGroup()
                        .addGroup(pnlEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(lblCustomerInfoPhoneNoTxt)
                            .addComponent(lblCustomerInfoNameTxt)
                            .addComponent(lblCustomerInfoAddressTxt)
                            .addComponent(lblCustomerInfoZipCodeTxt))
                        .addGap(6, 6, 6)
                        .addGroup(pnlEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtCustomerInfoPhone, javax.swing.GroupLayout.DEFAULT_SIZE, 234, Short.MAX_VALUE)
                            .addComponent(txtCustomerInfoName, javax.swing.GroupLayout.DEFAULT_SIZE, 234, Short.MAX_VALUE)
                            .addComponent(txtCustomerInfoAddress, javax.swing.GroupLayout.DEFAULT_SIZE, 234, Short.MAX_VALUE)
                            .addGroup(pnlEditLayout.createSequentialGroup()
                                .addComponent(txtCustomerInfoZipCode, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(lblCustomerInfoCityTxt)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtCustomerInfoCity, javax.swing.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE)))))
                .addContainerGap())
        );
        pnlEditLayout.setVerticalGroup(
            pnlEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlEditLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtCustomerInfoPhone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblCustomerInfoPhoneNoTxt))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtCustomerInfoName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblCustomerInfoNameTxt))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtCustomerInfoAddress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblCustomerInfoAddressTxt))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtCustomerInfoZipCode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblCustomerInfoCityTxt)
                    .addComponent(txtCustomerInfoCity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblCustomerInfoZipCodeTxt))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnlEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnCustomerInfoCreateCustomer)
                    .addComponent(btnCustomerInfoEditCustomer))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlSearch, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pnlEdit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pnlSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pnlEdit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void txtCustomerInfoPhoneActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtCustomerInfoPhoneActionPerformed
    }//GEN-LAST:event_txtCustomerInfoPhoneActionPerformed

    private void btnCustomerInfoCreateCustomerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCustomerInfoCreateCustomerActionPerformed

        String name = txtCustomerInfoName.getText();
        String address = txtCustomerInfoAddress.getText();
        String city = txtCustomerInfoCity.getText();
        String phone = txtCustomerInfoPhone.getText();
        String zipCode = txtCustomerInfoZipCode.getText();

        if (name.length() == 0 || phone.length() == 0) {
            JOptionPane.showMessageDialog(this, "Telefon nummer og navn skal udfyldes",
                    null, JOptionPane.WARNING_MESSAGE);
        } else {

            int phoneInt = 0;
            int zipCodeInt = 0;

            if (zipCode.length() > 0) {

                try {
                    zipCodeInt = Integer.parseInt(zipCode);
                } catch (Exception e) {
                    JOptionPane.showMessageDialog(this, "Postnummer skal være heltal",
                            null, JOptionPane.WARNING_MESSAGE);
                    return;
                }
            }

            try {
                phoneInt = Integer.parseInt(phone);
            } catch (Exception e) {
                JOptionPane.showMessageDialog(this, "Telefon indeholder ikke et gyldigt nummer",
                        null, JOptionPane.WARNING_MESSAGE);
                return;
            }

            try {
                controller.createCustomer(name, phoneInt, address, zipCodeInt, city);
                int firstRow = 0;
                int lastRow = controller.getCustomerCount() - 1;
                tableModel.fireTableRowsInserted(firstRow, lastRow);
            } catch (DuplicateCustomerIdentifierException dcie) {
                JOptionPane.showMessageDialog(this, "En anden kunde med det "
                        + "telefonnummer findes allerede", null,
                        JOptionPane.WARNING_MESSAGE);
                return;
            }


        }

    }//GEN-LAST:event_btnCustomerInfoCreateCustomerActionPerformed

    private void btnSearchCustomerClearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSearchCustomerClearActionPerformed
        txtSearchCustomer.setText("");
        filterTable();
    }//GEN-LAST:event_btnSearchCustomerClearActionPerformed

    private void btnCustomerInfoEditCustomerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCustomerInfoEditCustomerActionPerformed

        String name = txtCustomerInfoName.getText();
        String address = txtCustomerInfoAddress.getText();
        String city = txtCustomerInfoCity.getText();
        String phone = txtCustomerInfoPhone.getText();
        String zipCode = txtCustomerInfoZipCode.getText();

        if (name.length() == 0 || phone.length() == 0) {
            JOptionPane.showMessageDialog(this, "Navn og telefonnummer er påkrævet",
                    null, JOptionPane.WARNING_MESSAGE);
        } else {
            int phoneInt = 0;
            int zipCodeInt = 0;

            try {
                phoneInt = Integer.parseInt(phone);
            } catch (Exception e) {
                JOptionPane.showMessageDialog(this, "Telefon indeholder ikke et gyldigt nummer",
                        null, JOptionPane.WARNING_MESSAGE);
                return;
            }

            if (zipCode.length() > 0) {
                try {
                    zipCodeInt = Integer.parseInt(zipCode);
                } catch (Exception e) {
                    JOptionPane.showMessageDialog(this, "Postnummer skal være heltal",
                            null, JOptionPane.WARNING_MESSAGE);
                    return;
                }
            }

            try {
                controller.editCustomer(selectedCustomer, phoneInt, name, address, city, zipCodeInt);
            } catch (DuplicateCustomerIdentifierException ex) {
                JOptionPane.showMessageDialog(this, "Der findes allerede en kunde med dette telefonnr.",
                        null, JOptionPane.WARNING_MESSAGE);
                return;
            }

            updateCustomerFields();

            int firstRow = tblCustomers.getSelectedRow();
            int lastRow = firstRow;
            tableModel.fireTableRowsUpdated(firstRow, lastRow);

        }
    }//GEN-LAST:event_btnCustomerInfoEditCustomerActionPerformed

    private void txtSearchCustomerKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchCustomerKeyTyped
    }//GEN-LAST:event_txtSearchCustomerKeyTyped

    private void txtSearchCustomerKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSearchCustomerKeyReleased
        filterTable();
    }//GEN-LAST:event_txtSearchCustomerKeyReleased

    private void txtSearchCustomerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtSearchCustomerActionPerformed
        filterTable();
    }//GEN-LAST:event_txtSearchCustomerActionPerformed

    private void txtCustomerInfoPhoneFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtCustomerInfoPhoneFocusGained
        txtCustomerInfoPhone.selectAll();
    }//GEN-LAST:event_txtCustomerInfoPhoneFocusGained

    private void txtCustomerInfoNameFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtCustomerInfoNameFocusGained
        txtCustomerInfoName.selectAll();
    }//GEN-LAST:event_txtCustomerInfoNameFocusGained

    private void txtCustomerInfoAddressFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtCustomerInfoAddressFocusGained
        txtCustomerInfoAddress.selectAll();
    }//GEN-LAST:event_txtCustomerInfoAddressFocusGained

    private void txtCustomerInfoZipCodeFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtCustomerInfoZipCodeFocusGained
        txtCustomerInfoZipCode.selectAll();
    }//GEN-LAST:event_txtCustomerInfoZipCodeFocusGained

    private void txtCustomerInfoCityFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtCustomerInfoCityFocusGained
        txtCustomerInfoCity.selectAll();
    }//GEN-LAST:event_txtCustomerInfoCityFocusGained
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnCustomerInfoCreateCustomer;
    private javax.swing.JButton btnCustomerInfoEditCustomer;
    private javax.swing.JButton btnSearchCustomerClear;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel lblCustomerInfoAddressTxt;
    private javax.swing.JLabel lblCustomerInfoCityTxt;
    private javax.swing.JLabel lblCustomerInfoNameTxt;
    private javax.swing.JLabel lblCustomerInfoPhoneNoTxt;
    private javax.swing.JLabel lblCustomerInfoZipCodeTxt;
    private javax.swing.JPanel pnlEdit;
    private javax.swing.JPanel pnlSearch;
    private javax.swing.JTable tblCustomers;
    private javax.swing.JTextField txtCustomerInfoAddress;
    private javax.swing.JTextField txtCustomerInfoCity;
    private javax.swing.JTextField txtCustomerInfoName;
    private javax.swing.JTextField txtCustomerInfoPhone;
    private javax.swing.JTextField txtCustomerInfoZipCode;
    private javax.swing.JTextField txtSearchCustomer;
    // End of variables declaration//GEN-END:variables
}
